1. Field of the Invention
This invention generally relates to software applications and, more particularly, to a modular storage method and apparatus for use with software applications.
2. Description of the Related Art
Increasingly, software applications must run on a variety of data processing systems ranging from small handheld devices to powerful workstations. In most cases the software applications must be modified to run on each computer system. Some modifications may only require recompiling the software for a target computer system. Other modifications need to take into account physical characteristics of the computer system such as limited disk storage, processor power, or memory capacity. For example, a small handheld device with limited disk storage may have difficulty storing the contents of large documents used by a particular software application. To address this limitation, the storage methods used in the software application must be modified to accommodate storing the content of large documents on devices with small storage capacities.
In conventional software applications, however, it is often not possible to replace a method of storing the contents of a document without rewriting a significant portion of the software application. These conventional software applications store content and organize the structure of the content using an integrated software module. That is, a software method that processes content such as text also often processes the structural information that describes how the text is organized. Structural information, for example, includes formatting codes and instructions that organize a document into paragraphs, sentences, words, and characters. This integration of content storage and structural organization of a document makes it difficult to replace content storage routines without affecting other portions of the software application.
As a result, there is a tension between developing new methods for storing content in an application and reusing code. Instead of having several methods for storing content, the software developers will create a new version of software for each computer system. These additional versions increase the development costs, increase the costs of customer service, and increase software maintenance.
Users with different computer systems may also have problems using a software application available in different versions. In such instances, users may have to learn to operate different versions of the same software for each of their different computer systems. Customers may also have difficulty moving data and documents between computer systems running different versions of the same software application. For example, content stored using different versions of the same software may not be compatible.
To address these limitations, it would be desirable to replace the content storage methods of an application without modifying other portions of the software application. This would facilitate replacing a method of storing content in a software application without changing the method used to structure the content. This would promote increased software reuse and decrease software development costs.
In accordance with methods and systems consistent with the present invention, a method is provided that processes storing content of a document separately from processing the information used to describe the structure of the content. Content can be text, alphanumeric data, graphical data or any other information contained in a document. A layout operation uses information reflecting the structure of the content of a document such as paragraphs, sentences, and characters.
Such a method and system provide a content entity capable of storing and manipulating content stored in a storage area. The manipulation of content in the storage area includes inserting content in the content entity, removing content from the content entity, and retrieving content from the content entity. A separate document entity is provided that uses element entities to represent the structure of the text without the content of the text. The document entity retrieves information from the element entities to determine the location of content in the content entity. The information retrieved from the element entities is used to manipulate the content stored in the storage area associated with the content entity. Entities can be implemented in procedural software programming languages or object-oriented programming languages.
In accordance with another aspect of the present invention, a method is provided capable of replacing a content entity used to store content in a document. A software application loaded into a data processing system has a default content entity for storing content in a document. The method determines if the default content entity or a new content entity should be used based on the storage capacities of the data processing system. This determination is made by comparing the storage capacity of the system with the storage characteristics provided by the default content entity and other content entities. Based on a result of this determination, the software application may replace the default content entity with a new content entity. Upon execution, the software application uses a document entity to provide the structure of content in the document and the new content entity to provide the content associated with the document. entity and other content entities. Based on a result of this determination, the software application may replace the default content entity with a new content entity. Upon execution, the software application uses a document entity to provide the structure of content in the document and the new content entity to provide the content associated with the document.